<html>
<head>
<title>Length Check</title>
<style type="text/css">
table.pretty {
        border-width: 1px;
        border-spacing: 2px;
        border-style: solid;
        border-color: black;
        border-collapse: collapse;
        background-color: white;
}
table.pretty th {
        border-width: 1px;
        padding: 1px;
        border-style: inset;
        border-color: gray;
        background-color: white;
        -moz-border-radius: ;
}
table.pretty td {
        border-width: 1px;
        padding: 1px;
        border-style: inset;
        border-color: gray;
        -moz-border-radius: ;
}
table.pretty tr:hover {
        background-color: #ccc;
}
</style>
</head>
<body>
<table>
        <tr>
                <td align="left">
                        <a href="index.php">&ltBack</a>
                </td>
</table>
<hr />

<table class="pretty">
	<tr>
		<td>Start</td>
		<td>Length</td>
		<td>Filename</td>
	</tr>
<?php
$vars = parse_ini_file("../ini/settings.ini");
$connect = mysql_connect($vars["mysql_host"],$vars["mysql_username"],$vars["mysql_password"]) or die(mysql_error());
$db = mysql_select_db($vars["mysql_database"],$connect);
$sql = "select start,CONVERT(TIME_TO_SEC(timediff(end,start))/60,signed) as length,filename from torecord where start >=now() order by start";
$result = mysql_query($sql,$connect);
while ($row = mysql_fetch_array($result)) {
	$bgcolor="FFFFFF";
	if ($row[1] > 130) {
		$bgcolor="#F5697C";
	}
	echo "<tr bgcolor=\"$bgcolor\">\n";
	echo "<td>".$row[0]."</td>\n";
	echo "<td align=\"center\">".$row[1]."</td>\n";
	echo "<td>".$row[2]."</td>\n";
	echo "</tr>\n";
}
?>
</table>
</body>
</html>
